package com.kk.service;

import com.kk.entity.User;
import com.kk.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    
    public User login(String userCode, String password) {
        User user = userMapper.findByUserCode(userCode);
        if (user != null && user.getPassword().equals(password)) {
            return user;
        }
        return null;
    }
} 